home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2011 November
/
CHIP_2011_11.iso
/
Programy
/
Inne
/
Gry
/
Carnage_Contest
/
scripts
/
CC Original
/
tools
/
Small Block.lua
< prev
next >
Wrap
Text File
|
2009-08-29
|
1KB
|
39 lines
--------------------------------------------------------------------------------
-- Weapon Small Block
-- Original Carnage Contest Weapon
-- Script by DC, August 2009, www.UnrealSoftware.de
--------------------------------------------------------------------------------
-- Setup Tables
if cc==nil then cc={} end
cc.smallblock={}
-- Load & Prepare Ressources
cc.smallblock.gfx_wpn=loadgfx("buildings/smallblock.bmp") -- Weapon Image
setmidhandle(cc.smallblock.gfx_wpn)
cc.smallblock.sfx_build=loadsfx("buildstone.ogg") -- Build Sound
--------------------------------------------------------------------------------
-- Weapon: Small Block
--------------------------------------------------------------------------------
cc.smallblock.id=addweapon("cc.smallblock","Small Block",cc.smallblock.gfx_wpn,5) -- Add Weapon (5 uses)
function cc.smallblock.draw() -- Draw
-- HUD Positioning
if weapon_shots==0 then
hudpositioning(pos_build,cc.smallblock.gfx_wpn)
end
end
function cc.smallblock.attack(attack) -- Attack
if (weapon_shots<=0) and (weapon_position==1) then
-- Use weapon and allow to use another one afterwards (1)
useweapon(1)
weapon_shots=weapon_shots+1
-- Draw
terrainimage(cc.smallblock.gfx_wpn,weapon_x,weapon_y)
-- Sound
playsound(cc.smallblock.sfx_build)
end
end